<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<meta http-equiv="Cache-Control" content="no-siteapp">
		<link rel="stylesheet" href="./layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="./css/public.css" media="all" />
	</head>

	<body class="childrenBody">
		<form class="layui-form" lay-filter="formTest" id="form" style="width: 80%;">
			<!-- <div class="layui-form-item layui-row layui-col-xs12"  > -->
			<div class="layui-form-item layui-row layui-col-xs12">
				<input type="hidden" name="id" id="id" value="">
				<label class="layui-form-label">新密码</label>
				<div class="layui-input-block">
					<input type="password" class="layui-input" name="pwd" id="pwd" lay-verify="required|size" minsize="6" maxsize="32" placeholder="">
				</div>
			</div>
			<div class="layui-form-item layui-row layui-col-xs12">
				<label class="layui-form-label">确认密码</label>
				<div class="layui-input-block">
					<input type="password" class="layui-input" name="pwd2" lay-verify="required|size|confirm" equalto="pwd" minsize="6" maxsize="32" placeholder="">
				</div>
			</div>
			<div class="layui-form-item layui-row layui-col-xs12">
				<div class="layui-input-block">
					<button type="button" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="submit">提交</button>
					<button type="button" class="layui-btn layui-btn-sm layui-btn-primary close-btn">取消</button>
				</div>
			</div>
		</form>
		<script type="text/javascript" src="./js/jquery-2.1.1.min.js"></script>
		<script type="text/javascript" src="./layui/layui.js"></script>
		<script type="text/javascript" src="./custom/js/common.js"></script>
		<script type="text/javascript">
			layui.use(['form', 'layer'], function() {
				var form = layui.form;
				var layer = layui.layer;
				var $ = layui.jquery;
				var updatePwd = constant.baseUrl + "/updatePwd";
				var user = JSON.parse(cache.user.get());
				$("#id").val(user.id);
				form.on("submit(submit)", function(data) {
					loadAjax(updatePwd, "put", data.field, function(response) {
						layer.msg(response.msg, function() {
							var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
							parent.layer.close(index); //再执行关闭       
						});

					});
					return false;
				})
			})
		</script>
	</body>

</html>